import request from "@/util/request";

const BaseUrl = '/brand/'
const assoBraCate="/brand/brandCategory/"

export function addBrand(data) {
    return request({
        method: 'post',
        url: BaseUrl + 'add',
        data
    })
}
export function getBrands(pageNum,pageSize){
    return request({
        method: 'get',
        url: BaseUrl + `getToPage/${pageNum}/${pageSize}`,
    })
}

/*删除*/
export function delBrand(id){
    return request({
        method: 'delete',
        url: BaseUrl + `del/${id}`,
    })
}
export function modifyBrand(data){
    return request({
        method: 'put',
        url: BaseUrl +"modify",
        data
    })
}

/*新增品牌关联分类*/

export function addBrandCategory(data) {
    return request({
        method: 'post',
        url: assoBraCate + 'add',
        data
    })
}

/*获取品牌关联分类数据*/
export function getBrandCategory(brandId){
    return request({
        method: 'get',
        url: assoBraCate + `get/byBrandId/${brandId}`,
    })
}
export function getBrandByCatgoryId(categoryId){
    return request({
        method: 'get',
        url: assoBraCate + `get/byCategoryId/${categoryId}`,
    })
}
